<?php

session_start();

if(!isset($_SESSION["usermessage"])){
$result=array("msg"=>"请先登录","status"=>2);
print_r(json_encode($result));
    return;
}
$usermessage=$_SESSION["usermessage"];
$uid=json_decode(json_encode($usermessage))->id;


include "./DBhelper.php";

$sql="SELECT * FROM `carslist` WHERE `uid`='".$uid."'";

$resultData=sqlQuery($sql);

if($resultData->num_rows>=1){
    $data=array();
    while($row=$resultData->fetch_assoc()){
        array_push($data,$row);
    }
    $result=array("msg"=>"查询成功","status"=>1,"data"=>$data);
    print_r(json_encode($result));
}else{
    $result=array("msg"=>"查询失败","status"=>2);
    print_r(json_encode($result));
}
